package com.company.nuwa.common.enumration;

import com.company.nuwa.common.exception.BizException;

/**
 * <p>biz code interface</p >
 *
 * micro-service 端口后三位，业务码三位，共计六位
 *
 * @author Mitchell
 * @version 1.0
 * @date 2020/05/28 13:22
 */
public interface IBizCode {

    /**
     * code
     *
     * @return
     */
    Integer getCode();

    /**
     * message
     *
     * @return
     */
    String getMessage();

    default BizException toException() {
        return new BizException(this.getCode(), this.getMessage());
    }
}
